//
//  GMBaseLocalize.h
//  GMLanguage
//
//  Created by Mac on 2024/9/10.
//

#import <Foundation/Foundation.h>
#define GMMainBundleLocalizeString(x) [GMBaseLocalize localizedStringForKey:x table:nil]
#define GMMainBundleImage(x) [GMBaseLocalize imageNamed:x]

NS_ASSUME_NONNULL_BEGIN




@interface GMBaseLocalize : NSObject

/// 组件bundle,不会变
@property (nonatomic,strong,readonly)NSBundle *moduleBundle;

/// 组件资源bundle,不会变
@property (nonatomic,strong,readonly)NSBundle *resourcesBundle;

/// 语言code，对应多语言文件名字
@property (nonatomic,copy,readonly)NSString *languageCode;

/// 多语言对应传给服务端的值
@property (nonatomic,copy,readonly)NSString *serverLanguageValue;

/// 多语言对应的字符串值
@property (nonatomic,copy,readonly)NSString *languageStrValue;

/// 模块里面语言bundle，切换语言的时候对应跟着变
@property (nonatomic,strong,readonly,nullable)NSBundle *languageBundle;

/// 资源bundle名字，子类重写
- (NSString *)resouceBundleName;

+ (instancetype)sharedInstance;
+ (NSString *)localizedStringForKey:(NSString *)key value:(nullable NSString *)value;
+ (NSString *)localizedStringForKey:(NSString *)key;
+ (NSString *)localizedStringForKey:(NSString *)key table:(NSString*)table;
+ (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)value table:(NSString*)table;

/// 重置语言
/// - Parameter languageStrValue: 多语言字符串
+ (void)resetLanguageStrValue:(NSString *)languageStrValue;
+ (BOOL)currentLanguageIsRTLLanguage;
+ (BOOL)isChinese;
+ (BOOL)isEnglish;
+ (BOOL)isSimplifiedChinese;
+ (BOOL)isJapanese;

+ (UIImage *)imageNamed:(NSString *)name;


@end

NS_ASSUME_NONNULL_END
